<template>
    <div class="pack">
        <el-menu class="el-menu-vertical-demo" @open="handleOpen" @close="handleClose">
            <el-submenu index="1">
                <template slot="title">
                    <i class="el-icon-s-custom"></i>
                    <span>用户管理</span>
                </template>
                <el-menu-item-group>
                    <el-menu-item @click="clickItem('back_user')" index="back_user">后台用户列表</el-menu-item>
                    <el-menu-item @click="clickItem('front_user')" index="front_user">前台用户列表</el-menu-item>
                </el-menu-item-group>
            </el-submenu>

            <el-menu-item index="2" @click="clickItem('bugs_manage')">
                <i class="el-icon-bicycle"></i>
                <span slot="title">爬虫管理</span>
            </el-menu-item>

            <el-menu-item index="3" @click="clickItem('infos')">
                <i class="el-icon-notebook-1"></i>
                <span slot="title">信息列表</span>
            </el-menu-item>
        </el-menu>
    </div>
</template>
<style scoped>
.el-menu {
    border-right: 0px !important;
}
</style>
<script>
export default {
    data() {
        return {
            path: this.$route.path
        };
    },
    methods: {
        handleOpen(key, keyPath) {
            console.log(key, keyPath);
        },
        handleClose(key, keyPath) {
            console.log(key, keyPath);
        },
        clickItem(path) {
            if (this.$route.path != `/${path}`) {
                this.$router.push(path);
            }
        }
    }
};
</script>